/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Traffic;

/**
 *
 * @author Matthew
 */
public class TrafficLight {
    private LightState state;
    private Zone stopLine;


    TrafficLight(Zone stop)
    {
        stopLine = stop;
    }

    public LightState getState()
    {
        return state;
    }

    public void setState(LightState newState)
    {
        state = newState;
        if (newState == LightState.GREEN)
        {
            stopLine.setState(ZoneType.FREE);
        }
        else
        {
            stopLine.setState(ZoneType.BLOCKAGE);
        }
    }

}
